<?php

namespace App\Modules\System\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * Class Task 定时任务提醒
 * @package App\Modules\System\Models
 */
class Remindr extends Model
{
    protected $table = 'remindr';

    protected $fillable = ['id', 'user_id','type', 'music','plan', 'remindr_time', 'created_at', 'updated_at', 'status'];

    static function getList($user_id)
    {
        return self::where('status','>=',0)->where('user_id',$user_id)->get();
    }


    static function getDetails($id)
    {
        return self::where('id',$id)->first();
    }

    static function add($param)
    {
        // TODO check
        return self::create($param);
    }

    static function remindrUpdate($param)
    {
        // TODO check
        return self::where('id',$param['id'])->where('user_id',$param['user_id'])->update($param);
    }
}